package com.zhubayi.springcloud.alibaba.controller;

import com.zhubayi.springcloud.alibaba.doamin.CommonResult;
import com.zhubayi.springcloud.alibaba.doamin.Order;
import com.zhubayi.springcloud.alibaba.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhubayi
 */
@RestController
@RequestMapping("order")
public class OrderController {
    @Autowired
    private OrderService orderService;
    @GetMapping("create")
    public CommonResult create(Order order){
        //http://127.0.0.1:2001/order/create?userId=1&productId=1&count=10&money=100
        orderService.createOrder(order);
        return new CommonResult(200,"创建成功");
    }
}
